<?php
// +---------------------------------------------------------------------+
// | OneBase    | [ WE CAN DO IT JUST THINK ]                            |
// +---------------------------------------------------------------------+
// | Licensed   | http://www.apache.org/licenses/LICENSE-2.0 )           |
// +---------------------------------------------------------------------+
// | Author     | Bigotry <3162875@qq.com>                               |
// +---------------------------------------------------------------------+
// | Repository | https://gitee.com/Bigotry/OneBase                      |
// +---------------------------------------------------------------------+

namespace app\admin\validate;

/**
 * 汽车验证器
 */
class Cars extends AdminBase
{
    
    // 验证规则
    protected $rule =   [
        
        'carnumber'        => 'require|unique:cars',
        'cartype'              => 'require',
        'color'              => 'require',
        'price'              => 'require',
        'rentprice'              => 'require',
        
    ];   

    // 验证提示
    protected $message  =   [
      'carnumber.require'        => '汽车号码不能为空',
      'cartype.require'        => '汽车类型不能为空',
      'color.require'        => '汽车颜色不能为空',
      'price.require'        => '汽车价格不能为空',
      'rentprice.require'        => '汽车出租价格不能为空'
      
    ];

    // 应用场景
    protected $scene = [
        
        'edit' =>  ['carnumber','cartype','color','price','rentprice','creat_time','update_time','status'],
    ];
    
}
